import pandas as pd


class NhDataReader:

    def __init__(self):
        pass

    def read_data_excel(self, ):
        base_path = "F:/github/gitee_n/d2l-zh-1.2/nh_proj/data2.xlsx"
        data_xls = pd.io.excel.ExcelFile(base_path)
        xls = pd.ExcelFile(base_path)
        data_dict = {}
        print(data_xls.sheet_names)

        for name in data_xls.sheet_names:
            data_dict[name] = pd.read_excel(xls, sheetname=name, header=0)
        # data_dict['2017'] = pd.read_excel(base_path, sheet_name="2017", header=0)
        # data_dict['2018'] = pd.read_excel(xls, sheetname=[0,1,2], header=0)
        # data_dict['2019'] = pd.read_excel(xls, sheetname=None, header=0)
        #
        # for name in data_xls.sheet_names:
        #
        #     data_list.append(df)
        return data_dict

    def read_data_from_db(self):
        pass


if __name__ == '__main__':
    NhDataReader().read_data_excel()
    pass
